<?php

namespace app\controller;

use app\BaseController;
use Consul\Services\Agent;
use Consul\Services\Catalog;

class Index extends BaseController
{
    public function index()
    {
       $agent = new Agent();
       //  // 检测健康
       // $result = $agent->checks();


       //  // 获取服务列表
       // $result = $agent->services();
       //  //  注册服务
       // $result = $agent->registerService([
       //     'Name'    => 'Print',
       //     'Tags'    => ['php', 'print'],
       //     'Address' => 'http://minisv.cc',
       //     'Port'    => 80,
       // ]);
       // var_dump($result->getBody());


        //删除服务
        // $result = $agent->deregisterService('Print');
        // echo $result;

       //获取服务
       //  $catalog = new Catalog();
       //  $result = $catalog->service('Print');
       // //  echo ($result->getBody());
       //
       //  print_r($result->getBody());
    }

    public function hello($name = 'ThinkPHP8')
    {
        return 'hello,' . $name;
    }



    public function orderlog()
    {
        //
        echo 'orderlog';
    }
}
